<template>
    <div class="result">
        <h2 class="title">Curl</h2>
        <div class="curl hljs code-area">
            curl -X {{ responseData.config.method | toUpperCase }} --header 'Accept: {{ responseData.config.headers.Accept }}'
            'http://{{ baseUrl + tools.getRealUrl(disDocData, requestData) + tools.getQuery(requestData) }}'
        </div>
        <h2 class="title">Request URL</h2>
        <div class="request-url hljs code-area">
            http://{{ baseUrl + tools.getRealUrl(disDocData, requestData) + tools.getQuery(requestData) }}
        </div>
        <h2 class="title">Response Body</h2>
        <div class="response-body code-area" v-highlight="responseData.data">
        </div>
        <h2 class="title">Response Code</h2>
        <div>
            <div class="response-code code-area">{{ responseData.status }}</div>
        </div>
        <h2 class="title">Response Headers</h2>
        <div class="response-headers code-area" v-highlight="responseData.headers"></div>
    </div>
</template>
<script>
    import tools from '../lib/tools'
    export default {
        data() {
            return {
                tools
            }
        },
        props: ['responseData', 'requestData', 'baseUrl', 'disDocData'],

    }
</script>